package lesson02;

import java.util.ArrayList;
import java.util.List;

public class MyList {
    private List<String> list;
    public MyList(List<String> list){
        this.list=list;
    }

    public ArrayList<String> map(Operator operator){
        ArrayList<String> newList = new ArrayList<>();
        for(String word:list){
            newList.add( operator.operator(word));
      }
       return  newList;
    }
}
